package com.hwang.demo.controller;

import com.hwang.demo.service.IDemoService;
import com.hwang.mvc.annotations.MyAutowired;
import com.hwang.mvc.annotations.MyController;
import com.hwang.mvc.annotations.MyRequestMapping;
import com.hwang.mvc.annotations.MySecurity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author hwangrq
 * @date 2021/2/19 16:14
 * @description
 */
@MySecurity("admin")
@MyController
@MyRequestMapping("/demo")
public class DemoController {

    @MyAutowired
    private IDemoService demoService;

    @MyRequestMapping("/query")
    public String query(HttpServletRequest request, HttpServletResponse response, String name) {
        return demoService.get(name);
    }

    @MySecurity(value = {"吴宣仪","孟美岐","杨超越"})
    @MyRequestMapping("produce101")
    public String produce101(String username) {
        return demoService.get(username);
    }
}
